import { createRouter, createWebHistory } from 'vue-router'
import Agent from '../views/Agent.vue'
import Knowledge from '../views/Knowledge.vue'
import System from '../views/System.vue'
import Tools from '../views/Tools.vue'

const routes = [
  {
    path: '/',
    redirect: '/knowledge'
  },
  {
    path: '/agent',
    name: 'Agent',
    component: Agent
  },
  {
    path: '/knowledge',
    name: 'Knowledge',
    component: Knowledge
  },
  {
    path: '/system',
    name: 'System',
    component: System
  },
  {
    path: '/tools',
    name: 'Tools',
    component: Tools,
    redirect: '/tools/md-converter',
    children: [
      {
        path: 'md-converter',
        name: 'MdConverter',
        component: () => import('../views/MdConverter.vue')
      }
    ]
  },
  {
    path: '/knowledge/:id',
    name: 'KnowledgeDetail',
    component: () => import('../views/KnowledgeDetail.vue')
  },
  {
    path: '/agent/:id',
    name: 'AgentDetail',
    component: () => import('../views/AgentDetail.vue')
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router 